---
category: Validator
created: '2021-04-10'
title: Check if a value is base32 encoded
updated: '2021-10-13'
---

**JavaScript version**

```js isBase32.js
const isBase32 = (value) => value.length % 8 === 0 && /^[A-Z2-7]+=*$/.test(value);
```

**TypeScript version**

```ts isBase32.ts
const isBase32 = (value: string): boolean => value.length % 8 === 0 && /^[A-Z2-7]+=*$/.test(value);
```
